<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>继承</title>
</head>
<body>
    <script>
        function Person(name,age){
            this.name=name;
            this.age=age;
        }
        Person.prototype.run=function(){
            console.log(`${this.name} is running`);
        }
        function Teacher(name,age){
            Person.call(this,name,age);
        }
        Teacher.prototype=new Person();
        Teacher.prototype.addr=function(){
            console.log("aaa");
        }
        let t1=new Teacher("老师",24);
        t1.run();
    </script>

</body>
</html>